package main
//go get -u gitee.com/guang12134/go-plugindesign/oto
import (
	"gitee.com/guang12134/go-plugindesign/psend"
	"fmt"
)

func main() {
	k:=psend.Create_server("data_base")
	type datebase struct{
		Name string
		Age string
	}
	type hello struct{
		Msg string
	}
	k.Listen("/hello",datebase{},func(c *psend.C_content){
		var d datebase
		if err:=c.Read(&d);err!=nil{
			fmt.Println(err)
		}
		h:=hello{Msg:"hello "+d.Name+":"+d.Age}
		if err:=c.Write(h);err!=nil{
			fmt.Println(err)
		}
	})
	k.Server()
}
